<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>用户注册界面</title>
	<link rel="stylesheet" type="text/css" href="css/register.css">
	<link rel="stylesheet" type="text/css" href="css/top.css">
	<link rel="stylesheet" type="text/css" href="css/iconfont.css">
	<script type="text/javascript" >
		function check(){
			var userid=document.getElementById('userid').value;
			var password=document.getElementById('password').value;
			var username=document.getElementById('username').value;
			var location=document.getElementById('location').value;
			if(userid==""||userid==null){
				window.alert("电话不能为空！");
				document.reg.userid.focus();
				return false;
			}
			if(username==""||username==null){
				window.alert("姓名不能为空！");
				document.reg.username.focus();
				return false;
			}
			if(password==""||password==null){
				window.alert("密码不能为空！");
				document.reg.password.focus();
				return false;
			}
			if(location==""||location==null){
				window.alert("地址不能为空！");
				document.reg.location.focus();
				return false;
			}
			return true;
		}
	</script>

  </head>
  
  <body>
	<%
		String msg = (String) session.getAttribute("msg");
		session.setAttribute("msg","");
	%>
    <form id="bigBox"method="POST" action="/express/servlet/UserLogin?role=user&modth=reg" name="reg" onsubmit="return check()">
        <h1>用户注册</h1>
        <font color="red">
            <span id="message">
                <%if(msg==null){msg="";} %>
                <%=msg %>
            </span>
       </font>
        <!-- 注册界面容器 -->
        <div class="inputBox">
            <!-- 用户电话 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-phone"></i>
                    账号:
                </span>
                <input type="text" id="userid" name="userid" placeholder="Userphone">
            </div>
            <!-- 用户名 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-user"></i>
                    姓名:
                </span>
                <input type="text" id="username" name="username" placeholder="Username">
            </div>
            <!-- 密码 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-password"></i>
                    密码:
                </span>
                <input type="text" id="password" name="password" placeholder="Password">
            </div>
            <!-- 地址 -->
            <div class="inputText">
                <span>
                    <i class="iconfont icon-address"></i>
                    地址:
                </span>
                <input type="text" id="location" name="location" placeholder="Address">
            </div>
            <!-- 注册按钮 -->
            <input type="submit" class="inputButton" value="注册">
            <!-- 返回按钮 -->
            <a href="regindex.jsp">
                <input type="button" class="inputButton" value="返回">
            </a>
        </div>
    </form>
  </body>
</html>
